﻿namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
    using System;

    /// <summary>
    /// Specifies the assembly resource to embed in the assembly.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    [CLSCompliant(false)]
    public class AssemblyBuilderResourceAttribute : Attribute
    {
        private readonly string[] resourceItems;
        private readonly string resourceName;

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="AssemblyBuilderResourceAttribute"/> class.
        /// </summary>
        /// <param name="resourceName">Name of the resource.</param>
        /// <param name="resourceItems">The resource items. There are two elements per resource. First the key and then the value.</param>
        public AssemblyBuilderResourceAttribute(string resourceName, params string[] resourceItems)
        {
            this.resourceName = resourceName;
            this.resourceItems = resourceItems;
        }
        #endregion Constructors

        #region Public Properties
        /// <summary>
        /// Gets the resource items.
        /// </summary>
        /// <value>The resource items.</value>
        public string[] ResourceItems
        {
            get { return this.resourceItems; }
        }

        /// <summary>
        /// Gets the name of the resource.
        /// </summary>
        /// <value>The name of the resource.</value>
        public string ResourceName
        {
            get { return this.resourceName; }
        }
        #endregion Public Properties
    }
}